/**
 * @(#)ProcessDefinitionVO.java Nov 10, 2009
 *   
 * Copyright  (c) 2009-2010 Wilmar IT Service,  Inc.   
 * All  rights  reserved.   
 * TODO
 */

package com.wilmar.process.entity.vo;

import org.jbpm.api.ProcessDefinition;

/**
 * @author MaKuBEX Email:makubexnet@gmail.com
 * @version 1.0.0
 */
public class ProcessDefinitionVO extends AbstractValueObject implements
		ValueObject {

	/**
	 * @serialField
	 */
	private static final long serialVersionUID = -6973009188316534961L;

	private String deploymentId;
	private String description;
	private int version;
	private String id;
	private String imageResourceName;
	private String key;
	private String name;
	private String releaseNote;
	private String outerSystem;
	private String createPerson;
	private String createTime;

	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((deploymentId == null) ? 0 : deploymentId.hashCode());
		return result;
	}

	/**
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ProcessDefinitionVO other = (ProcessDefinitionVO) obj;
		if (deploymentId == null) {
			if (other.deploymentId != null)
				return false;
		} else if (!deploymentId.equals(other.deploymentId))
			return false;
		return true;
	}

	public ProcessDefinitionVO(ProcessDefinition definition,
			ProcessReleaseNotesVO releaseNotes) {
		this.deploymentId = definition.getDeploymentId();
		this.description = definition.getDescription();
		this.id = definition.getId();
		this.imageResourceName = definition.getImageResourceName();
		this.key = definition.getKey();
		this.name = definition.getName();
		this.version = definition.getVersion();
		this.outerSystem = releaseNotes.getOuterSystem();
		this.releaseNote = releaseNotes.getReleaseNote();
		this.createTime = releaseNotes.getCreateTime();
		this.createPerson = releaseNotes.getCreatePerson();
	}

	/**
	 * @return the deploymentId
	 */
	public String getDeploymentId() {
		return deploymentId;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @return the version
	 */
	public int getVersion() {
		return version;
	}

	/**
	 * @return the id
	 */
	public String getId() {
		return id;
	}

	/**
	 * @return the imageResourceName
	 */
	public String getImageResourceName() {
		return imageResourceName;
	}

	/**
	 * @return the key
	 */
	public String getKey() {
		return key;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param deploymentId
	 *            the deploymentId to set
	 */
	public void setDeploymentId(String deploymentId) {
		this.deploymentId = deploymentId;
	}

	/**
	 * @param description
	 *            the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @param version
	 *            the version to set
	 */
	public void setVersion(int version) {
		this.version = version;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}

	/**
	 * @param imageResourceName
	 *            the imageResourceName to set
	 */
	public void setImageResourceName(String imageResourceName) {
		this.imageResourceName = imageResourceName;
	}

	/**
	 * @param key
	 *            the key to set
	 */
	public void setKey(String key) {
		this.key = key;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the releaseNote
	 */
	public String getReleaseNote() {
		return releaseNote;
	}

	/**
	 * @param releaseNote
	 *            the releaseNote to set
	 */
	public void setReleaseNote(String releaseNote) {
		this.releaseNote = releaseNote;
	}

	/**
	 * @return the outerSystem
	 */
	public String getOuterSystem() {
		return outerSystem;
	}

	/**
	 * @param outerSystem
	 *            the outerSystem to set
	 */
	public void setOuterSystem(String outerSystem) {
		this.outerSystem = outerSystem;
	}

	/**
	 * @return the createPerson
	 */
	public String getCreatePerson() {
		return createPerson;
	}

	/**
	 * @param createPerson
	 *            the createPerson to set
	 */
	public void setCreatePerson(String createPerson) {
		this.createPerson = createPerson;
	}

	/**
	 * @return the createTime
	 */
	public String getCreateTime() {
		return createTime;
	}

	/**
	 * @param createTime
	 *            the createTime to set
	 */
	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}
}
